<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"  src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		function pause(numberMillis) {
		    var now = new Date();
		    var exitTime = now.getTime() + numberMillis;
		    
		    while (true) {
		         now = new Date();
		         if (now.getTime() > exitTime)
		             return;
		    }
		}
		$("#btn1").attr('checked',function(){
			setTimeout(check(),2000);
		});
		
		function check(){
			alert("ASdf");
		}
	});
</script>
</head>
<body>
<form action="" method="post">
<table border="1"> 
	<tr>
		<td>	
		<c:choose>
			<c:when test="${requestScope.flag eq 'Y' }">
		  <input type="checkbox" name="go" value="Y" id="btn1"<c:if test="${requestScope.flag eq 'Y' }">checked="checked"</c:if>>
				<img src="img/DICOM-Files.gif">
			</c:when>
			<c:otherwise>
			<input type="checkbox">
				<img src="img/1.jpg">
			</c:otherwise>
		 </c:choose></td>
	</tr>
	<tr>
		<td>
			<span id="test">
				<img src="img/1.jpg">
			</span>
		</td>
	</tr>
</table>
<button id="btn" name="command" value="go">시작</button>
<button id="btn2" name="command" value="stop">스톱</button>
${requestScope.i }
</form>
</body>
</html>